profiles: decouple "board_name" and "profile" from "platform" variable#71
profiles: decouple "board_name" and "profile" from "platform" variable#71map-b wants to merge 1 commit intoefahl:mainfrom
Conversation
|
Hello Eric, I am really hope we can agree at least with these renames... I finally got time to look into owut code, and I can understand your concerns... it is a bit confusing, you mostly implemented this code about two years ago and I suppose your were mainly using the special x86 /"generic" case. There should not be any logic change. In most cases |
e3414da to
1e3fdfa
Compare
| arch: null, // "x86_64" or "mipsel_24kc" or "aarch64_cortex-a53", contained in platform_json | ||
| target: target, // "x86/64" or "ath79/generic" or "mediatek/mt7622", from system board | ||
| board_name: board_name, // "generic" (for x86) or "tplink,archer-c7-v4" or "linksys,e8450-ubi" | ||
| profile: profile, // "generic", "tplink_archer-c7-v4" or "linksys_e8450-ubi", used to match profiles in profiles.json | ||
| fstype: sysb.rootfs_type, // "ext4" or "squashfs", what is actually present now | ||
| sutype: sutype, // Sysupgrade type, combined, combined-efi or sysupgrade or sdcard |
Just separate the, now a bit overloaded, variable "device.platform" which represents: the board_name(dts compatible) and profile into two explicit variables trying to make clearer the profile identification process during ASU sysupgrades. The old "sanitized" device.platform now would be "device.profile" while the raw board_name is kept in "device.board_name". In the mapping case code, rename "real_platform" to "platform_profile" and "alias" to "board_name" in order to make clearer the translation/mapping being done: board_name -> profile Rename standalone "profile" to a more representative "platform_profile" since it represents a tuple from the platform dictionary (profiles.json). Adapted some log outputs and show the two variables when printing the previous single "device.platform". No change in the logic, nothing should be different after this change.
1e3fdfa to
1abc8ea
Compare
| let target = sysb.release.target; | ||
| let platform = replace(sysb.board_name, /,/, "_"); | ||
| let board_name = sysb.board_name; | ||
| let profile = replace(board_name, /,/, "_"); |
There was a problem hiding this comment.
Maybe now do you see a bit clear that this is a shortcut for the mapping/translation, it works in most cases and avoid the bit compute of the translation but the canonical/correctness is doing the translation/mapping. Is not this reasonable? Can not we even talk?
This was my whole point with those reverts in ASU side about the "sanitization" vs "translation".
|
Do you not believe yet that I followed this to the bottom? Even Paul got confused :P with the namings openwrt/openwrt@2a07270#commitcomment-171740773 I just found this looking for examples of cases where the mapping is required, for example those devices using the BOARD_NAME in their images recipes (like those octeon, "er"). |
| // https://github.com/efahl/owut/issues/2#issuecomment-2165021615 | ||
|
|
||
| url.platform = `${url.upstream}/${release.dir}/targets/${device.target}/profiles.json`; | ||
| let platform = dl_platform(); |
There was a problem hiding this comment.
Please efahl, apologies for whatever reason you don't even talk, but this is for the project. You need to be open and keep neutral even if someone makes mistakes, you should encourage everyone to join and help. I really tried to not make too noise or communicate in excess, and only give my opinion in cases where I can be moderate confident that it's right.
Back on topic, this is the "platform" which I keep referring to, also called "target\subtarget" (profiles.json), but the other one, the "device.platform" referring to the board_name/profile... Isn't it confusing?
Just separate the, now a bit overloaded, variable "device.platform" which represents: the board_name(dts compatible) and profile into two explicit variables trying to make clearer the profile identification process during ASU sysupgrades.
The old "sanitized" device.platform now would be "device.profile" while the raw board_name is kept in "device.board_name".
In the mapping case code, rename "real_platform" to "platform_profile" and "alias" to "board_name" in order to make clearer the translation/mapping being done: board_name -> profile
Rename standalone "profile" to a more representative "platform_profile" since it represents a tuple from the platform dictionary (profiles.json).
Adapted some log outputs and show the two variables when printing the previous single "device.platform".
No change in the logic, nothing should be different after this change.